Welcome To
Escape
Sequences


Escape Sequences In Python

The escape sequences are special character that understand by the python interpreter then displayed the result in some way . the escape sequences is also called backslash sequences. The escape sequences are used before the backward slash followed by the escape characters .

The python provides the more Escape sequences That is in the below

Escape sequences Description Example Output
\n
it is used to break the line and print the result as new line print("Drashan is a web developer \n That is good") Drashan is a web developer
That is good
\t
it is used to space between elements and print the result as some space. this is horizontal tab print("5\t2") 5   2
\\
it is used to insert a backslash into string print("Darshan\\coder") Darshan\ coder
'\"' and '\'
it is used to insert a double or single quotes into string print("Hello \"Coders") Hello" coders
\r
it is denoted the ASCII Carriage Return(CR) character,which resets the cursor to the beginning of the line print("Hello,\rworld ") world
\f
Denoted the ASCII Form feed Character, which originally represented the start of a new page in printers print("Hello \f"Coders") Hello Coders